package main.java.collection;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo2 {
    public static void main(String[] args) {
        Collection<Point> c= new ArrayList<Point>();
        c.add(new Point(1,2));
        c.add(new Point(3,4));
        c.add(new Point(5,6));
        c.add(new Point(7,8));
        System.out.println(c);

        Point p1= new Point(1,2);
        boolean b = c.contains(p1);
        System.out.println("是否包含p1:"+b);

        c.remove(p1);//在集合中移除指定元素并返回布尔型结果
        System.out.println(c);
    }
}
